package com.xzx.util;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;

import java.util.Collections;

/**
 *
 * @author xinzhixuan
 * @version 1.0
 * @date 2025/8/30 17:49
 */
public class MPGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/mp", "root", "Admin_111")
        .globalConfig(builder -> builder
                .author("xzx")
                .outputDir("/Users/xinzhixuan/work/git2/mybatis1234/mybatis-plus-01-springboot/src/main/java")
                .commentDate("yyyy-MM-dd")
        )
        .packageConfig(builder -> builder
                .parent("com.xzx")
                .entity("po2")
                .mapper("mapper2")
                .service("service2")
                .serviceImpl("service2.impl")
                .pathInfo(Collections.singletonMap(OutputFile.xml, "/Users/xinzhixuan/work/git2/mybatis1234/mybatis-plus-01-springboot/src/main/resources/mapper"))
        )
        .strategyConfig(builder -> builder
                .entityBuilder()
                .enableLombok()
                .controllerBuilder().disable()
        )
        .execute();
    }
}
